<script setup>
import { getUserTruckAPI } from '@/api/user'
import { ref } from 'vue'
// 车辆数据
const truchInfo = ref({})
//获取车辆数据
const getUserTruch=async()=>{
  const res = await getUserTruckAPI()
   // 检测接口否调用成功
   if (res.code !== 200) return uni.utils.toast()
  // console.log(res);
  truchInfo.value = res.data
}
getUserTruch()
</script>

<template>
  <view class="page-container">
    <swiper class="truck-pictures" indicator-active-color="#fff" circular indicator-dots>
      <swiper-item v-for="item in truchInfo.pictureList" :key="item.url">
        <image class="picture" mode="aspectFill" :src="item.url"></image>
      </swiper-item>
      
    </swiper>
    <view class="truck-meta">
      <uni-list :border="false">
        <uni-list-item :border="false" title="车辆编号" :rightText="truchInfo.id" />
        <uni-list-item :border="false" title="车辆号牌" :rightText="truchInfo.licensePlate" />
        <uni-list-item :border="false" title="车型" :rightText="truchInfo.truckType" />
        <uni-list-item :border="false" title="所属机构" :rightText="truchInfo.currentOrganName" />
        <uni-list-item :border="false" title="载重" :rightText="truchInfo.allowableLoad + ' 吨'" />
      </uni-list>
    </view>
  </view>
</template>

<style lang="scss" scoped>
  @import './index.scss';
</style>